# Requesting
# rp = Rp.new(policy)
# rp.services(user_supplied_identifier).each { |service|  
#   if service.support? :auth
#     service.association = Association.findb_by_endpoint(service.endpoint) # find or get
#     return service
#   end
# }
# redirect_to service # override to_s method

# Authentication
# if openid_request?(params)
# end

module OpenidEngine
  # TYPES = {
  #   '2.0' => {
  #     'SERVER' => 'http://specs.openid.net/auth/2.0/server',
  #     'SIGNON' => 'http://specs.openid.net/auth/2.0/signon'
  #   }
  # }
  TYPE_URI = {
    :auth2p0 => 'http://specs.openid.net/auth/2.0',
    :auth1p1 => 'http://openid.net/signon/1.1',
    :sreg1p0 => 'http://openid.net/sreg/1.0',
    :sreg1p1 => 'http://openid.net/extensions/sreg/1.1',
    :pape200706 => 'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant',
    :ax1p0 => 'http://openid.net/srv/ax/1.0'
  }
  
  
  # def type(name, version='2.0')
  #   TYPES[version][name.to_s.upcase]
  # end
  
  class Error < StandardError
  end
end
